package com.matrix.java.chap_06;

/*
    英尺和米之间的转换
    double footToMeter
    double meterToFoot
 */
public class Ex6_09 {
    public static void main(String[] args) {
        System.out.println("英尺\t米\t\t米\t英尺");
        double i = 1;
        double j = 20;
        do {
            double meter = footToMeter(i);
            double foot = meterToFoot(j);
            System.out.printf("%.1f\t%.3f\t\t", i, meter);
            System.out.printf("%.1f\t%.3f\t\t\n", j, foot);
            i++;
            j += 5;
        } while (i < 10 && j < 65);


    }

    private static double meterToFoot(double meter) {
        return 3.279 * meter;
    }

    private static double footToMeter(double foot) {
        return 0.305 * foot;
    }
}
